<!--
 * @Descripttion: 
 * @version: @ 1.0.0
 * @Author: 朱江洲
 * @Date: 2021-10-18 08:32:26
 * @LastEditors: 朱江洲
 * @LastEditTime: 2021-12-21 09:30:37
-->
<template>
  <div></div>
</template>

<script>
import { getToken, setToken, removeToken } from "@/utils/auth";
import { getExamBatchById } from "../../api/IndividualUser/signUp";
export default {
  data() {
    return {
      query: {},
    };
  },
  created() {
    this.query = this.$route.query;
    console.log(this.query.name);
    this.tokenTo();
  },
  mounted() {
    this.$nextTick(function () {
      if (this.query.id) {
        this.$router.push(`/studentInfo?id=${this.query.id}`);
        this.getDetail();
      } else if (this.query.name == "myOrder") {
         this.$router.push(`/myOrder`);
      } else {
        this.$router.push(`/index`);
      }
    });
  },
  methods: {
    tokenTo() {
      setToken(this.query.token);
      this.$store.dispatch("tokenTo", +this.query.token);
    },
    getDetail() {
      getExamBatchById({
        id: this.query.id,
      }).then((res) => {
        sessionStorage.setItem("ExaInfo", JSON.stringify(res.data));
      });
    },
  },
};
</script>

<style lang="less" scoped>
</style>
